import { View } from "@tarojs/components";
import CustomLayout from "@/components/CustomLayout";
import { useLoad } from "@tarojs/taro";
import { Image } from "@nutui/nutui-react-taro";
import { ArrowSize6, Setting } from "@nutui/icons-react-taro";
import { goToPage } from "@/utils/common";
import "./index.scss";

function Index() {
  const list = [
    {
      name: "对话设置",
      url: "/packageA/pages/settingDialogue/index",
    },
    {
      name: "字体大小",
      url: "/packageA/pages/settingVoicePack/index",
    },
    {
      name: "语言设置",
      url: "/packageA/pages/settingVoicePack/index",
    },
    {
      name: "语音包选择",
      url: "/packageA/pages/settingVoicePack/index",
    },
    {
      name: "关于我们",
      url: "/packageA/pages/settingAboutUs/index",
    },
  ];

  return (
    <>
      <CustomLayout.Header title="设置" />
      <CustomLayout.Body className="setting_page">
        <View className="setting_page_list">
          {list?.map((item: any, index: number) => {
            return (
              <View
                key={index}
                className="setting_page_list_item"
                onClick={() => goToPage(item?.url)}
              >
                <View className="setting_page_list_item_name">
                  {item?.name}
                </View>
                <ArrowSize6 />
              </View>
            );
          })}
        </View>
        <View className="setting_page_cache"></View>
      </CustomLayout.Body>
    </>
  );
}

export default Index;
